<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>
        人员列表
    </title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/main.css" media="all">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.css">
</head>
<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
              <a><cite>首页</cite></a>
              <a><cite>业主信息管理</cite></a>
              <a><cite>人员列表</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right"  href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form x-center" action="${pageContext.request.contextPath}/personnel/listUi" style="width:800px">
        <div class="layui-form-pane" style="margin-top: 15px;">
            <div class="layui-form-item">
                <label class="layui-form-label"  style="width: 100px">业主查询</label>
                <div class="layui-input-inline">
                    <input class="layui-input" placeholder="请输入条件" name="somename">
                </div>
                <div class="layui-input-inline" style="width:80px">
                    <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon">&#xe615;</i></button>
                </div>
            </div>
        </div>
    </form>
    <xblock>
        <button class="layui-btn" type="submit" onclick="personnel_add('添加成员','${pageContext.request.contextPath}/personnel/addUi','1000','600')">
            <i class="layui-icon">&#xe608;</i>添加
        </button>
        <span class="x-right" style="line-height:40px">共有数据：<span class="layui-badge">${pers.size()}</span> 条</span>
    </xblock>
    <table class="layui-table">
        <thead>
        <tr>
            <th>ID</th>
            <th>所属小区</th>
            <th>所属房产</th>
            <th>成员名称</th>
            <th>成员照片</th>
            <th>身份证号</th>
            <th>联系方式</th>
            <th>职业</th>
            <th>出生日期</th>
            <th>性别</th>
            <th>成员类型</th>
            <th>备注</th>
            <th>创建时间</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        </thead>
        <tbody id="x-img">

            <c:forEach items="${pers}" var="per" varStatus="status">
                <tr>
                <td hidden>${per.id}</td>
                <td>${status.index+1}</td>
                <td>${per.community.name}</td>
                <td>${per.bname}</td>
                <td>${per.name}</td>
                <td>
                    <img src="${pageContext.request.contextPath}/images/${per.img}" width="40px">
                </td>

                <td>${per.peopleNum}</td>
                <td>${per.contactWay}</td>
                <td>${per.occupation}</td>
                <td> <fmt:formatDate pattern="yyyy/MM/dd HH:mm:ss" value="${per.birthday}"/></td>
                <td> <c:if test="${per.sex}">男</c:if>
                    <c:if test="${!per.sex}">女</c:if></td>
                <td>${per.mname}</td>
                <td>${per.remark}</td>
                <td><fmt:formatDate pattern="yyyy/MM/dd HH:mm:ss" value="${per.createTime}"/></td>
                <td><c:if test="${!per.state}">禁用</c:if>
                    <c:if test="${per.state}">可用</c:if></td>
                <td class="td-manage">
                    <a title="编辑" href="javascript:;" onclick="personnel_edit('编辑','${pageContext.request.contextPath}/personnel/editUi','${per.id}','1000','600')"
                       class="ml-5" style="text-decoration:none">
                        <i class="layui-icon">&#xe642;</i>
                    </a>
                    <a title="删除" href="${pageContext.request.contextPath}/personnel/update?id=${per.id}" style="text-decoration:none">
                        <i class="layui-icon">&#xe640;</i>
                    </a>
                </td>
                </tr>
            </c:forEach>


        </tbody>
    </table>
</div>
<script src="${pageContext.request.contextPath}/lib/layui/layui.js" charset="utf-8"></script>
<script src="${pageContext.request.contextPath}/js/x-layui.js" charset="utf-8"></script>
<script>
    layui.use(['laydate','element','laypage','layer'], function(){
        $ = layui.jquery;//jquery
        lement = layui.element();//面包导航
        layer = layui.layer;//弹出层

        //以上模块根据需要引入
        layer.ready(function(){ //为了layer.ext.js加载完毕再执行
            layer.photos({
                photos: '#x-img'
                //,shift: 5 //0-6的选择，指定弹出图片动画类型，默认随机
            });
        });
    });
    /*添加*/
    function personnel_add(title,url,w,h){
        x_admin_show(title,url,w,h);
    }
    //编辑
    function personnel_edit (title,url,id,w,h) {
        url = url+"?id="+id;
        x_admin_show(title,url,w,h);
    }
</script>

</body>
</html>